package domain

import (
	"github.com/google/uuid"
	"gorm.io/gorm"
)

// It embeds gorm.Model and overwrites ID to uuid string.
type BaseModel struct {
	gorm.Model
	ID string `gorm:"primarykey"`
}

type ActionLogModel struct {
	CreatedBy string
	UpdatedBy string
}

func (this *BaseModel) BeforeCreate(tx *gorm.DB) (err error) {
	this.ID = uuid.New().String()

	return nil
}
